package com.zyx.mapper;

import com.zyx.pojo.Relevancy;
import com.zyx.pojo.RelevancyExample;

import java.util.Date;
import java.util.List;

import com.zyx.pojo.Spencer;
import org.apache.ibatis.annotations.Param;

public interface RelevancyMapper {
    long countByExample(RelevancyExample example);

    int deleteByExample(RelevancyExample example);

    int deleteByPrimaryKey(Integer relecancyId);

    int insert(Relevancy record);

    int insertSelective(Relevancy record);

    List<Relevancy> selectBySpencer();

    /**
     * 根据店铺id查询店铺所有车辆名称
     * @param i
     * @return
     */
    List<Relevancy> selectByAutoName(int i);
    /**
     * 根据店铺id查询店铺所有车辆信息
     * @param i
     * @return
     */
    List<Relevancy> selectByAuto(int i);

    //查询店铺车辆数量
    int queryByCount(int spencerId);

    //根据车型id和车辆id查询店铺
    List<Spencer> querySpencer(@Param("autoId") int autoId,@Param("carId") int carId);

    //查询店铺车辆类型
    List<Relevancy> queryByType(int spencerId);

    //查询店铺某个车辆类型的车辆型号
    List<Relevancy> queryByAuto(@Param("spencerId")Integer spencerId,@Param("carId")Integer carId);

    //根据车辆类型id删除店铺中的车辆信息
    Integer deleteByAutoId(Relevancy relevancy);

    //根据车辆名称id删除店铺中的车辆信息
    int deleteByCarId(@Param("carId")Integer carId,@Param("spencerId")Integer spencerId);

    //根据车辆id和店铺id查询是否含有值
    List<Relevancy> exists(@Param("spencerId")Integer spencerId,@Param("carId")Integer carId,@Param("autoId")Integer autoId);

    //查询所有店铺车辆和店铺名称
    List<Relevancy> queryAll();

    List<Relevancy> queryAllScreen(Relevancy relevancy);

    List<Relevancy> selectByAutoNow(@Param("spencerId") int i,@Param("timeMarket") Date timeMarket);

    List<Relevancy> selectByExample(RelevancyExample example);

    Relevancy selectByPrimaryKey(Integer relecancyId);

    int updateByExampleSelective(@Param("record") Relevancy record, @Param("example") RelevancyExample example);

    int updateByExample(@Param("record") Relevancy record, @Param("example") RelevancyExample example);

    int updateByPrimaryKeySelective(Relevancy record);

    int updateByPrimaryKey(Relevancy record);
}